home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / visulztn / saoimage / saoimage.lha / hfiles / cgraph.h < prev    next >
C/C++ Source or Header  |  1989-11-09  |  5KB  |  117 lines

  1. #ifndef lint
  2. static char SccsCgraphId[] = "%W%  %G%";
  3. #endif
  4.  
  5. /* Module:    Cgraph.h
  6.  * Purpose:    Define the structs for color graph parameters and some
  7.  *        related constants
  8.  * Modified:    {0} Michael VanHilst    initial version           9 June 1989
  9.  *        {n} <who> -- <does what> -- <when>
  10.  */
  11.  
  12. #define MAXPOINTS 512        /* COLMAPSZ * 2 */
  13. #define HASH_RAY 2
  14. #define HASH_SZ 4
  15.  
  16. #define BDRWDTH 1
  17. #define INDENT 3
  18.  
  19. struct colgRec {        /* ensemble for one color */
  20.   int active;            /* this-color-is-being-manipulated */
  21.   int unset;            /* line-does-not-match-current-state */
  22.   struct subtableRec *table;    /* color information */
  23.   GCspec *draw;            /* info for color gc to draw this graph */
  24.   int active_vertex;        /* vertex being manipulated */
  25.   int active_hash;        /* hash mark being manipulated */
  26.   int hash_0;            /* index in table of hash[0] */
  27.   int queue_index;        /* position in drawing queue */
  28.   int hash_cnt;            /* number of hash marks */
  29.   int pad;            /* allignment space */
  30.   XRectangle hash[PSEUDOSZ];    /* hash marks for X */
  31.   XPoint line[MAXPOINTS];    /* graph line for this color */
  32. };
  33.  
  34. /* struct for drawing a colorbar (one under display, one under color graph */
  35. struct colbarRec {        /* parameters for color bar */
  36.   Display *display;        /* display handle of colorbox */
  37.   Window ID;            /* handle of bar subwindow */
  38.   int ref_width, ref_height;    /* colorbox size when last checked */
  39.   unsigned int width, height;    /* dimensions of bar subwindow */
  40.   int ncolors;            /* number of shades represented */
  41.   XImage *image;        /* uses image struct of colorbox */
  42.   int data_size;        /* data allocated (both byte and bit) */
  43.   int bytes_per_bit_line;    /* bytes per line for bitmap */
  44.   char *byte_data;        /* one byte per pixel */
  45.   char *bit_data;        /* one bit per pixel (after byte_data */
  46. };
  47.  
  48. struct cgraphRec {
  49.   int inactive;            /* do-not-draw-graph */
  50.   int vertical;            /* 1=vertical sweep, else horizontal */
  51.   int ncolors;            /* number of image color cells */
  52.   int point_cnt;        /* applies to all color lines */
  53.   int bargraph;            /* use-bar-type-instead-of-line */
  54.   Font font;            /* font id for XDrawImageString */
  55.   XFontStruct *fontstruct;    /* struct for font size info */
  56.   GCspec *disp;            /* gc info to draw bar */
  57.   GCspec *menu;            /* gc info for text */
  58.   GCspec *black;        /* gc info for black text and lines */
  59.   struct colbarRec bar;        /* parameters for color bar */
  60.   struct {            /* parameters to label the bar */
  61.     Window min_ID;        /* lowest color (0) subwindow */
  62.     Window max_ID;        /* highest color (ncolors-1) subwindow */
  63.     int min_x, min_y;        /* lowest color label placement */
  64.     int max_x, max_y;        /* highest color label placement */
  65.     int width, height;        /* size of both label subwindows */
  66.     int base_width;        /* dimension of basic label for centering */
  67.     int base_height;
  68.   } barlabel;
  69.   struct {            /* parameters for color graph */
  70.     Display *display;        /* display handle of graphbox */
  71.     Window ID;            /* handle of graph subwindow */
  72.     int ref_width, ref_height;    /* size of graphbox when last checked */
  73.     int ncolors;        /* number of shades represented */
  74.     int width, height;        /* size of graph subwindow */
  75.     int xzero, yzero;        /* graph area offset */
  76.     int xwidth, yheight;    /* graph area dimensions */
  77.     int xmax, ymax;        /* maximum drawing coordinate */
  78.     double Xwidth, Yheight;    /* often used double version */
  79.     double Xinc, Yinc;        /* color spacing (ncolors/width or height) */
  80.   } graph;
  81.   struct {            /* parameters to label the graph */
  82.     Window gamma_ID;        /* window in which to label gamma */
  83.     Window minmax_ID;        /* window in which to label min & max */
  84.     int width, height;        /* size of both label subwindows */
  85.     Window geq_ID;        /* borderless box with "g=" */
  86.     Window red_ID;        /* red border box for red gamma */
  87.     Window green_ID;        /* green border box for green gamma */
  88.     Window blue_ID;        /* blue border box for blue gamma */
  89.     int box_width, box_height;    /* size of each gamma val boxes */
  90.     int box_x, box_y;        /* text string coord in box */
  91.     int geq_width, geq_height;    /* size of "g=" box */
  92.     int geq_text_x, geq_text_y;    /* text string coord in "g=" box */
  93.     int three_limit;        /* minimum size to hold 3 gamma vals */
  94.     int four_limit;        /* three_limit plus the "g=" */
  95.     int geq_x, geq_y;        /* placement of "g=" box */
  96.     int red_x, red_y;        /* placement of red box */
  97.     int green_x, green_y;    /* placement of green box */
  98.     int blue_x, blue_y;        /* placement of blue box */
  99.     int min_x, min_y;        /* placement of "min" text string */
  100.     int max_x, max_y;        /* placement of "max" text string */
  101.     int minmax_xoff;        /* coordinate offset from right */
  102.     int minmax_yoff;        /* coordinate offset from bottom */
  103.     int active;            /* label the color bar and graph */
  104.     int geq_active;        /* include "g=" in gamma label */
  105.   } graphlabel;
  106.   struct {            /* special values for hash marks */
  107.     double Xzero, Yzero;    /* offset by HASH_RAY */
  108.     double Xwidth, Yheight;    /* decremented by inc */
  109.     double Ymax;        /* perceptually, y goes upward from max */
  110.   } hash;
  111.   struct colgRec red;        /* ensemble for red */
  112.   struct colgRec green;        /* ensemble for green */
  113.   struct colgRec blue;        /* ensemble for blue */
  114.   int queue_cnt;        /* number of color ensembles in queue */
  115.   struct colgRec *queue[3];    /* pointers to establish order of drawing */
  116. };
  117.